#! /user/bin/python3
# coding=utf-8
# @Time:2024/7/3 11:05
# @Author:WentR
import datetime
import os


def get_now_time():
    return datetime.datetime.now()


def get_project_path():
    """""
    获取项目绝对路径
    :return:
    """""
    project_name = "Auto"
    file_path = os.path.dirname(__file__)
    print(file_path)
    return file_path[:file_path.find(project_name) + len(project_name)]


def sep(path, add_sep_before=False, add_sep_after=False):
    """
    系统分隔符
    Args:
        path: 路径列表，类型为数组
        add_sep_before: 是否需要在拼接的路径前加一个分隔符
        add_sep_after: 是否需要在拼接的路径后加一个分隔符

    Returns:

    """
    all_path = os.sep.join(path)
    if add_sep_before:
        all_path = os.sep + all_path
    if add_sep_after:
        all_path = all_path + os.sep
    return all_path


if __name__ == '__main__':
    # print(get_now_time())
    get_project_path()
    sep(['config', 'environment.yaml'], add_sep_before=True)
